package common;
import java.io.UnsupportedEncodingException;
import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Properties;

import javax.naming.NamingException;
import javax.servlet.http.*;

import command.Command;
import command.CommandException;
import db.CommonConnect;
import common.CommonUtil;
import db.QueryManager;
import db.DAO;


public class agent_fin_msg  {
	public static void main(String[] args) throws Exception{
            Connection con          = null;
            CallableStatement call  = null;
            ResultSet rs            = null;



            try {
                Class.forName("com.mysql.jdbc.Driver");
                if (args[0].toString().equals("test")) {
                	con = DriverManager.getConnection ("jdbc:mysql://10.10.20.143:3306/lms","eduhrd_lms_site","site5508448");
                } else {
                	con = DriverManager.getConnection ("jdbc:mysql://192.168.2.27:9110/lms","eduhrd_lms_site","site5508448");
                }

                call = con.prepareCall("{call STD_FIN_MSG_SEND(1)}");


                call.execute();

				String inDate   = new java.text.SimpleDateFormat("yyyyMMdd").format(new java.util.Date());
            	String inTime   = new java.text.SimpleDateFormat("HHmmss").format(new java.util.Date());
                System.out.println("agent_fin_msg excuted at " + inDate + inTime);

            } catch (SQLException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }finally{
                con.close();
                con.close();
            }
	}
}

